﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO.IsolatedStorage;

namespace Norma43
{
    public partial class recalcul : PhoneApplicationPage
    {
        private IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;
        public recalcul()
        {
            InitializeComponent();
            // Controlem el boto enrere
            this.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(OnBackKeyPress);

        }

        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void ContentPanel_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                IPCcamp.Text = (String)appSettings["IPC"];
                SouMensual.Text = (String)appSettings["Sou"];
                EuriborCamp.Text = (String)appSettings["Euribor"];
                Estalvis.Text = (String)appSettings["Estalvis"];
            }
            catch (Exception Ex) { };
        }

        private void OnBackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
        {
            appSettings["IPC"] = IPCcamp.Text;
            appSettings["Sou"] = SouMensual.Text;
            appSettings["Euribor"] = EuriborCamp.Text;
            appSettings["Estalvis"] = Estalvis.Text;
        }


    }
}
